def get_date_str(date: str) -> str:
    if not date.isnumeric(): return '0'
    return date[:4] + ('0' if int(date[4:6]) <= 6 else '1')

def get_sem_str(date: str, sid: str) -> str:
    if len(sid) != 12 or not date.isnumeric() or not sid.isnumeric(): sem_str = '0'
    else:
        ### Notice
        grade = int(date[2:4])-int(sid[1:3])
        if grade < 0 or grade > 10:
            grade = -1
        sem_str = sid[0] + str(grade)

    return sem_str
